package com.bdqn.crm.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bdqn.crm.mapper.SysRightMapper;
import com.bdqn.crm.mapper.SysRoleMapper;
import com.bdqn.crm.pojo.SysRight;
import com.bdqn.crm.pojo.SysRole;
import com.bdqn.crm.service.SysRoleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 *
 */
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole>
        implements SysRoleService {

    @Resource
    private SysRoleMapper sysRoleMapper;

    @Resource
    private SysRightMapper sysRightMapper;

    /**
     * 角色增删改查
     *
     * @return
     */
    @Override
    public List<SysRole> findAllRoles() {
        return null;
    }

    /**
     * 权限查询
     *
     * @return
     */
    @Override
    public List<SysRight> findAllRights() {
        return sysRightMapper.selectList(null);
    }

    @Override
    public List<SysRight> findRightsByRole(SysRole role) {
        return sysRoleMapper.findRightsByRole(role);
    }

    @Override
    public List<SysRole> selectPages(String roleName, Integer pageIndex, Integer pageSize) {
        return sysRoleMapper.selectPages(roleName,pageIndex,pageSize);
    }
}




